3.7 \(\int \cos (c+d x) (a+a \sin (c+d x)) \, dx\)

Optimal. Leaf size=22 \[ \frac{(a \sin (c+d x)+a)^2}{2 a d} \]

[Out]

(a + a*Sin[c + d*x])^2/(2*a*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0163306, antiderivative size = 28, normalized size of antiderivative = 1.27, number of steps used = 2, number of rules used = 1, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.059, Rules used = {2667} \[ \frac{a \sin ^2(c+d x)}{2 d}+\frac{a \sin (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + a*Sin[c + d*x]),x]

[Out]

(a*Sin[c + d*x])/d + (a*Sin[c + d*x]^2)/(2*d)

Rule 2667

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rubi steps

\begin{align*} \int \cos (c+d x) (a+a \sin (c+d x)) \, dx &=\frac{\operatorname{Subst}(\int (a+x) \, dx,x,a \sin (c+d x))}{a d}\\ &=\frac{a \sin (c+d x)}{d}+\frac{a \sin ^2(c+d x)}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0133389, size = 39, normalized size = 1.77 \[ -\frac{a \cos ^2(c+d x)}{2 d}+\frac{a \sin (c) \cos (d x)}{d}+\frac{a \cos (c) \sin (d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + a*Sin[c + d*x]),x]

[Out]

-(a*Cos[c + d*x]^2)/(2*d) + (a*Cos[d*x]*Sin[c])/d + (a*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.009, size = 25, normalized size = 1.1 \begin{align*}{\frac{1}{d} \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{2}a}{2}}+a\sin \left ( dx+c \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+a*sin(d*x+c)),x)

[Out]

1/d*(1/2*sin(d*x+c)^2*a+a*sin(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 0.94099, size = 27, normalized size = 1.23 \begin{align*} \frac{{\left (a \sin \left (d x + c\right ) + a\right )}^{2}}{2 \, a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(a*sin(d*x + c) + a)^2/(a*d)

________________________________________________________________________________________

Fricas [A]  time = 1.61103, size = 62, normalized size = 2.82 \begin{align*} -\frac{a \cos \left (d x + c\right )^{2} - 2 \, a \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(a*cos(d*x + c)^2 - 2*a*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.220222, size = 34, normalized size = 1.55 \begin{align*} \begin{cases} \frac{a \sin ^{2}{\left (c + d x \right )}}{2 d} + \frac{a \sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a \sin{\left (c \right )} + a\right ) \cos{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*sin(d*x+c)),x)

[Out]

Piecewise((a*sin(c + d*x)**2/(2*d) + a*sin(c + d*x)/d, Ne(d, 0)), (x*(a*sin(c) + a)*cos(c), True))

________________________________________________________________________________________

Giac [A]  time = 1.11971, size = 34, normalized size = 1.55 \begin{align*} \frac{a \sin \left (d x + c\right )^{2} + 2 \, a \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

1/2*(a*sin(d*x + c)^2 + 2*a*sin(d*x + c))/d